<?php

// Home 模块
Route::namespace('Home')->group(function () {
    // 首页
    Route::get('/', 'IndexController@index');
});
// 后台登录页面
Route::group(['namespace'=>'Admin','prefix'=>'admin','middleware'=>'web'],function (){
    //后台管理员
    Route::any('login', 'AuthController@login')->name('admin.login');
    Route::any('logout', 'AuthController@logout')->name('admin.logout');
    //首页
    Route::get('index', 'IndexController@index');
    Route::get('console', 'IndexController@console');
    Route::any('upload', 'IndexController@upload')->name('admin.upload');//原图上传
    Route::any('uploadedit', 'IndexController@uploadedit')->name('admin.uploadedit');//原图上传
    Route::any('uploads', 'IndexController@uploads')->name('admin.uploads');//压缩上传
    //轮播图
    Route::get('banner', 'BannerController@banner')->name('admin.banner');
    Route::get('bannerdata', 'BannerController@bannerdata')->name('admin.bannerdata');
    Route::any('addbanner', 'BannerController@addbanner')->name('admin.addbanner');
    Route::any('editbanner/{id?}', 'BannerController@editbanner')->name('admin.editbanner');
    Route::any('editbannerup', 'BannerController@editbannerup')->name('admin.editbannerup');
    Route::any('delbanner', 'BannerController@delbanner')->name('admin.delbanner');
    Route::any('banner_state_off', 'BannerController@state_off')->name('admin.banner_state_off');
    Route::any('banner_state_on', 'BannerController@state_on')->name('admin.banner_state_on');
    //名师
    Route::get('teacher', 'TeacherController@teacher')->name('admin.teacher');
    Route::get('teacherdata', 'TeacherController@teacherdata')->name('admin.teacherdata');
    Route::any('addteacher', 'TeacherController@addteacher')->name('admin.addteacher');
    Route::any('editteacher/{id?}', 'TeacherController@editteacher')->name('admin.editteacher');
    Route::any('editteacherup', 'TeacherController@editteacherup')->name('admin.editteacherup');
    Route::any('delteacher', 'TeacherController@delteacher')->name('admin.delteacher');
    Route::any('teacher_state_off', 'TeacherController@state_off')->name('admin.teacher_state_off');
    Route::any('teacher_state_on', 'TeacherController@state_on')->name('admin.teacher_state_on');
    Route::any('teacher_recommend_on', 'TeacherController@recommend_on')->name('admin.teacher_recommend_on');
    Route::any('teacher_recommend_off', 'TeacherController@recommend_off')->name('admin.teacher_recommend_off');
    //课程
    Route::get('course', 'CourseController@course')->name('admin.course');
    Route::get('coursedata', 'CourseController@coursedata')->name('admin.coursedata');
    Route::any('addcourse', 'CourseController@addcourse')->name('admin.addcourse');
    Route::any('editcourse/{id?}', 'CourseController@editcourse')->name('admin.editcourse');
    Route::any('editcourseup', 'CourseController@editcourseup')->name('admin.editcourseup');
    Route::any('delcourse', 'CourseController@delcourse')->name('admin.delcourse');
    Route::any('course_state_off', 'CourseController@state_off')->name('admin.course_state_off');
    Route::any('course_state_on', 'CourseController@state_on')->name('admin.course_state_on');
    Route::any('course_recommend_on', 'CourseController@recommend_on')->name('admin.course_recommend_on');
    Route::any('course_recommend_off', 'CourseController@recommend_off')->name('admin.course_recommend_off');
    //订单
    Route::get('orders', 'OrderController@orders')->name('admin.orders');
    Route::get('odata', 'OrderController@odata')->name('admin.odata');
    //用户
    Route::get('users', 'UserController@users')->name('admin.users');
    Route::get('udata', 'UserController@udata')->name('admin.udata');
    //分类
    Route::any('cate', 'CateController@cate')->name('admin.cate');
    Route::any('cates', 'CateController@cates')->name('admin.cates');
    Route::any('addcate', 'CateController@addcate')->name('admin.addcate');
    Route::any('addsubcate/{id?}', 'CateController@addsubcate')->name('admin.addsubcate');
    Route::any('addsubcateup', 'CateController@addsubcateup')->name('admin.addsubcateup');
    Route::any('editcate/{id?}', 'CateController@editcate')->name('admin.editcate');
    Route::any('editcateup', 'CateController@editcateup')->name('admin.editcateup');
    Route::any('delcate', 'CateController@delcate')->name('admin.delcate');

    Route::get('tmd', 'TmdController@tmd')->name('admin.tmd');
    Route::get('data', 'TmdController@data')->name('admin.data');
    Route::get('form', 'TmdController@form')->name('admin.form');
    Route::get('operaterule', 'IndexController@operaterule');
});
// 老师后台登录页面
Route::group(['namespace'=>'Customer','prefix'=>'customer','middleware'=>'web'],function (){

    //老师后台管理
    Route::any('login', 'AuthController@login')->name('customer.login');
    Route::any('logout', 'AuthController@logout')->name('customer.logout');
    //首页
    Route::get('index', 'IndexController@index');
    Route::get('console', 'IndexController@console');
    Route::any('upload', 'IndexController@upload')->name('customer.upload');//原图上传
    Route::any('uploadedit', 'IndexController@uploadedit')->name('customer.uploadedit');//原图上传
    Route::any('uploads', 'IndexController@uploads')->name('customer.uploads');//压缩上传
    //课程
    Route::get('course', 'CourseController@course')->name('customer.course');
    Route::get('coursedata', 'CourseController@coursedata')->name('customer.coursedata');
    Route::any('addcourse', 'CourseController@addcourse')->name('customer.addcourse');
    Route::any('editcourse/{id?}', 'CourseController@editcourse')->name('customer.editcourse');
    Route::any('editcourseup', 'CourseController@editcourseup')->name('customer.editcourseup');
    Route::any('delcourse', 'CourseController@delcourse')->name('customer.delcourse');
    Route::any('course_state_off', 'CourseController@state_off')->name('customer.course_state_off');
    Route::any('course_state_on', 'CourseController@state_on')->name('customer.course_state_on');
    Route::any('course_recommend_on', 'CourseController@recommend_on')->name('customer.course_recommend_on');
    Route::any('course_recommend_off', 'CourseController@recommend_off')->name('customer.course_recommend_off');
    //订单
    Route::get('orders', 'OrderController@orders')->name('customer.orders');
    Route::get('odata', 'OrderController@odata')->name('customer.odata');
    //用户
    Route::get('users', 'UserController@users')->name('customer.users');
    Route::get('udata', 'UserController@udata')->name('customer.udata');
});
// Route::group(['namespace'=>'Api','prefix'=>'api','middleware'=>'api'],function (){
//     //首页课程
//     Route::any('course', 'ApiController@course')->name('api.course');
// });